/*
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2024-01-13 14:50:22
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-31 14:34:42
 * @FilePath: \My-bolg\server\router\friend.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
let {
    addfriends,
    getfriend,
    getgountfrient,
    auditFriends,
    searchfriend,
    deleteFriend,
    updatelinks,
    deleteimgname
} = require("../controller/friend.js");
let {everfyaddprams,everfygetprams,everfysercgprams} = require("../middleware/friend.js");
let express = require("express");
const { auth } = require("../util/user.js");
const {isSuperAdmin} = require('../controller/user.js')
let router = express.Router();
/* -------------------- 后台*/
router.get("/getfriend",everfygetprams,getfriend);
router.get("/getgountfrient",auth,getgountfrient)
router.post("/auditFriends",auth,isSuperAdmin,auditFriends)
router.post("/searchfriend",auth,everfysercgprams,searchfriend)
router.post("/deleteFriend",auth,isSuperAdmin,deleteFriend)
router.post("/updatelinks",auth,isSuperAdmin,updatelinks)
router.post("/deleteimg",auth,deleteimgname)
/* --------------------前台 */
router.post("/addfriend",everfyaddprams,addfriends);
module.exports = router;


